package one.stand.dto;

import cn.hutool.core.util.StrUtil;
import lombok.Data;
import one.stand.util.OneConstant;

@Data
public class Company2Dto {
    private Integer companyId;
    private Integer userId;
    private String companyLogo;
    private String companyName;
    private Integer companyLevel;
    private String phone;
    private String userName;

    private String addrArea;
    private String addrStreet;
    private String addrNo;

    private Integer delFlag;

    /**
     * 计算店铺等级
     */
    public Integer countCompanyLevelView() {
        return companyLevel > 3 ? 5 : companyLevel + 1;
    }

    public String countAddress() {
        return StrUtil.concat(true, addrArea, addrStreet, addrNo);
    }

    public boolean countAdmin(Integer userId) {
        return this.userId.equals(userId);
    }

    public boolean countOn() {
        return OneConstant.ZERO.equals(delFlag);
    }
}
